package com.hitqz.robot.dispatch.netty.strategy.zhiqingDispather;

import lombok.Data;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Polygon;
@Data
public class Path {
    private double beginX;
    private double beginY;
    private double endX;
    private double endY;

    public Path(double beginX, double beginY, double endX, double endY) {
        this.beginX = beginX;
        this.beginY = beginY;
        this.endX = endX;
        this.endY = endY;
    }

    // 获取矩形框（基于X和Y的范围） 都加上0.5做缓冲
    public static Polygon getBoundingBox(Coordinate[] coordinates) {
        GeometryFactory factory = new GeometryFactory();


        return factory.createPolygon(coordinates);
    }
}